package tasks

import "github.com/RocksonZeta/hubx"

const (
	PropUser = "user"
)

type User struct {
	Id    int
	Name  string
	Icon1 string
	Icon2 string
}

func getUser(client *hubx.Client) User {
	user, ok := client.Props.Load(PropUser)
	if ok {
		return user.(User)
	}
	return User{}
}

const (
	RoleAdmin    = "admin"
	RoleTeacher  = "teacher"
	RolePlayer   = "player"
	RoleObserver = "observer"
)

var observerMsg = map[string]bool{
	"im": true, //即时消息
}
var playerMsg = map[string]bool{
	"im": true,
}

type initMsg struct {
	Id         int
	State      int
	TimerState int
	BlackUid   int
	WhiteUid   int
	Turn       int
}

const (
	msgTaskNew         = "tasknew"
	msgTaskUpdate      = "taskupdate"
	msgTaskDelete      = "taskdelete"
	msgTaskStateChange = "taskstatechange"
)
